Skip to content

chore: remove requirements.txt to resolve dependency build error#3

Merged
samdoghor merged 2 commits into
mainfrom
fix-client-args
Apr 3, 2026
Merged

chore: remove requirements.txt to resolve dependency build error#3
samdoghor merged 2 commits into
mainfrom
fix-client-args

Conversation

@samdoghor
Copy link
Copy Markdown
Owner

This pull request introduces several improvements to the codebase, focusing on enhanced validation, more robust error handling, and the addition of comprehensive tests. It also includes minor dependency and version updates. The most significant changes are grouped below.

Error Handling and Validation Improvements:

  • Replaced generic ValueError exceptions with custom ClientConfigError in TermiiClient for missing API key or base URL, providing clearer error messages and guidance.
  • Improved phone number validation by ensuring only strings are accepted and returning False for non-string inputs in is_valid_phone_number.
  • Refactored message sending logic in send_message and send_bulk_message to normalize and validate the channel and type parameters, with clearer error messages for invalid combinations. [1] [2]

Testing Enhancements:

  • Added new test modules: test_client.py, test_http.py, and test_value_object.py to verify client configuration, HTTP request handling, and phone number validation, respectively. These tests cover both successful cases and error scenarios. [1] [2] [3]
  • Updated pyproject.toml to include pytest as an optional dependency for testing.

Code Quality and Maintenance:

  • Updated file upload logic in RequestHandler.post_file to use a context manager, ensuring files are properly closed after upload.
  • Bumped the package version from 0.1.0 to 0.1.2 in termii_py/__init__.py.

Cleanup:

  • Removed redundant repeated error checks in the TermiiClient initializer after moving them earlier in the method.

@samdoghor samdoghor merged commit 27a3d33 into main Apr 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant